    	var soStatus;
    	function yemian(uid,limit,offset,status){

			$.ajax({
				url :Server + "/rel/ssi/serviceOrderPageList",
				//url :"http://localhost/rel/ssi/serviceOrderPageList",
				data : {
					"uid":uid,
					//"uid": "4d272484d5844be693c05443c4edd71e",
					"limit":limit,
					"offset":offset,
					"status":status
				},
				type : "POST",
				dataType: "JSON",
				success : function(data) {
					if(data.total==0){
						$("#pagination3").hide();
					}
					$("#pagination3").pagination({
						currentPage: 1,
						totalPage: Math.ceil(Number(data.total/5)),
						isShow: true,
						count: 7,
						homePageText: "首页",
						endPageText: "尾页",
						prevPageText: "<上一页",
						nextPageText: "下一页>",
						callback: function(current) {
							//yemian(uid,limit,$("#pagination3").pagination("getPage").current-1,status);
							infoLikeListofinfo(uid,limit,$("#pagination3").pagination("getPage").current-1,status);
						}
					});
				}
			});
		}
    	
		function infoLikeListofinfo(uid,limit,offset,status){
			
//			alert("js1");
			$.ajax({
				url :Server + "/rel/ssi/serviceOrderPageList",
				//url :"http://localhost/rel/ssi/serviceOrderPageList",
				data : {
					"uid":uid,
					//"uid": "4d272484d5844be693c05443c4edd71e",
					"limit":limit,
					"offset":offset,
					"status":status
				},
				type : "POST",
				dataType: "JSON",
				success : function(data) {

					var top = 
				'  <div class="item1">服务名称</div>'
				+' <div class="item2"></div>'
				+' <div class="item3">服务收费</div>'
				+' <div class="item4">结果获取时间</div>'
				+' <div class="item5">交易状态</div>'
				+' <div class="item6">交易操作</div>'
				+' </div>';
					var html = "";
					var item = "";
					var pattern =
						'<li> '
						+'<div class="row1">'
						+'<div>'
						+'	<span>#2 </span>'
						+'	<span>订单编号: #3</span>'
						+'	</div>'
						+'<div><img class="delete2" onclick="deleSO(#99)" src="images/usercenter_icon2.png" /></div>'
						+'</div>'
						+'<div class="row2">'
						+'	<div class="tab1"><img src="#0" /></div>'
						+'	<div class="tab2"><a href="#33">#1</div>'
						+'	<div class="tab3">¥#4#5</div>'
						+'<div class="tab4">#44</div>'
						+'<div class="tab5">'
					+'		<p>#11</p>'
					+'	<p>'
					+'		<a onclick="details(#88,#98)">查看详情</a>'
					+'	</p>'
					+'</div>'
					+'<div class="tab6">'
					+'	<div class="btn" onclick=userManage(#77,#78,"#79",#80) name="servBtn">'
					+'		<a>#22</a>'
							+'	</div>'
							/*+'	<div class="time">还剩<span id="LeftTime"></span></div>'*/
							+'<div class="time"><span id="#8"></span></div>'
							+'</div>'
							+'</div>'
							+'	</li>';
					
					for (var i = 0; i < data.rows.length; i++) {
						Status = "";
						Status1 = "";
						switch (data.rows[i].status) {
						case 0:
							Status = "预约中";
							Status1 = "";
							break;
						case 1:
							Status = "预约成功";
							Status1 = "支付";
							break;
						case 2:
							Status = "已支付";
							Status1 = "";
							break;
						case 3:
							Status = "等待结果上传";
							Status1 = "";
							break;
						case 4:
							Status = "等待确认";
							Status1 = "确认";
							break;
						case 5:
							/*Status = "已实验";
							Status1 = "评价";*/
							if(data.rows[i].rate==1||data.rows[i].rate==3){
								Status = "已评价";
								Status1 = "";
							}else if(data.rows[i].rate==2||data.rows[i].rate==0){
								Status = "未评价";
								Status1 = "评价";
							}
							break;
						case 6:
							Status = "交易关闭";
							Status1 = "";
							break;
						}
						if(data.rows[i].ssimagelist[0]!=null){
							var imgPath = data.rows[i].ssimagelist[0].imagePath;
						}
						else {
							var imgPath = "imgError.jpg";
						}
							var getTime = new Date();
							item = pattern
								.replace("#77", data.rows[i].serviceInfo.serviceId)//服务id
								.replace("#88", data.rows[i].serviceInfo.serviceId)//服务id
								//.replace("#87", data.rows[i].serviceId)//服务id
								.replace("#78", data.rows[i].id)//订单id
								.replace("#99", data.rows[i].id)//订单id
								.replace("#98", data.rows[i].id)//订单id
								//.replace("#97", data.rows[i].id)//订单id
								.replace("#0", imgPath)//图片
								.replace("#1", data.rows[i].serviceInfo.serviceName)//服务名
								.replace("#2", new Date(data.rows[i].createTime).Format("yyyy-MM-dd hh:mm:ss")) //订单开始时间
								.replace("#3", data.rows[i].number)//订单编号
								.replace("#4", data.rows[i].serviceInfo.serviceFee)//费用
								.replace("#44", timestampToTime(getTime.setDate(getTime.getDate() + data.rows[i].serviceInfo.getTime)))//结果获取时间
								.replace("#11", Status)//订单状态
								.replace("#22", Status1)//操作订单状态
								//.replace("#21", Status1)//操作订单状态
								.replace("#79", Status1)//操作订单状态
								.replace("#5", data.rows[i].serviceInfo.unit)//单位
								.replace("#80", data.rows[i].rate)
								.replace("#8", data.rows[i].id)
								.replace("#33", "publishService21?modify=false&serviceId="+data.rows[i].serviceInfo.serviceId)//服务id
							html += item;
//							if(Status1==null || Status1==''||Status1=="")
//								$("#manage").remove();
					}
					$("#topThings").html(top);
					$("#orderList").html(html);
					for (var i = 0; i < data.rows.length; i++) {
						if(data.rows[i].status == 1){
							Tuitime2(""+ data.rows[i].id ,new Date(data.rows[i].createTime).getTime()/1000);
						}
					}
					$("div[name='servBtn']").each(function(){
						var btnContent=$(this).children().eq(0).text();
						if(btnContent==""){
							$(this).parent().empty();
						}else if(btnContent=="实验"||btnContent=="完成"||btnContent=="评价"){
							$(this).next().remove();
						} 
					});
					$(".tab5").each(function(){
						var statusStr=$(this).children().eq(0).text();
						if(statusStr!="预约中"&&statusStr!="已评价"&&statusStr!="交易关闭"){
							$(this).parent().prev().children().eq(1).hide();
						}
					});
				},
			});
		}

		//1111初始加载
//		$(document).ready(function(){
//			alert("$(".list_header1").html();
////			loadSO();
//			$(".list_header1>.secendList1>.insOrderLi").each(function(){
//				$(this).click(function() {
//					alert($(this).attr("val"));
//					var status=$(this).attr("val");
//					loadSO(status);
//				});
//			});
//	});

		function loadSO(status){
			var uid = $("#useridoflogin").val();
//			var uid = 23;
			var limit = 5;
			var offset = 0;
			yemian(uid,limit,offset,status);
			infoLikeListofinfo(uid,limit,offset,status);
		}

		function details(serviceId,soid){
			$(location).attr('href', 'new_file3_2?serviceId='+serviceId+'&'+'soid='+soid+'&display=false');
		}
		function userManage(serviceId,soid,Status1,nowRate){
			if(Status1=='评价'){
				$(location).attr('href', 'comment14-4?serviceId='+serviceId+'&'+'soid='+soid+'&nowRate='+nowRate+'');
			}
//			else if(Status1.equals('')||Status1.equals("")||Status1==null){
//				$(this).remove();
//			}
			else if(Status1=='确认'){
				$(location).attr('href', 'confirmationResult?oid='+soid+''); 
			}
			else{
				$(location).attr('href', 'new_file3_2?serviceId='+serviceId+'&'+'soid='+soid+'&display=true');
			}
		}
		
		Date.prototype.Format = 
			function(fmt){
			var o = {
				"M+": this.getMonth() + 1, //月份 
       			"d+": this.getDate(), //日 
        		"h+": this.getHours(), //小时 
        		"m+": this.getMinutes(), //分 
        		"s+": this.getSeconds(), //秒 
        		"q+": Math.floor((this.getMonth() + 3) / 3), //季度 
        		"S": this.getMilliseconds() //毫秒 
			};
			if(/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
			for(var k in o)
			if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    		return fmt;
		}
		function findDetail(serviceId,oid){
			$(location).attr('href', 'new_file3_2?serviceId='+serviceId+''+'&soid='+soid+'');
		}
		
		function changeStatus(id,status){
			$.ajax({
				url :Server + "/orderRelevant/changeStatus",
				//url :"http://localhost/orderRelevant/changeStatus",
				data : {
					"id":id,
					"status":status
				},
				type : "POST",
				//dataType: "JSON",
				success : function(data) {
					loadSO();
				},
			});	
		}
		
		function deleSO(oid){
					var r=confirm("确定要删除吗？");
					if(r==true){
						$.ajax({
							url :Server + "/orderRelevant/deleteOrder",
							//url :"http://localhost/orderRelevant/deleteOrder",
							data : {
								"id":oid
							},
							type : "POST",
							//dataType: "JSON",
							success : function(data) {
								alert(data);
								loadSO(soStatus);
							}
						});	
					}
				}
		/* 时间倒计时 */
		var Tuitime2 = function(){
	        var list = [];
	        var interval;
			return function(id,time){
				interval = setInterval(myfun,1);
				list.push({ele:document.getElementById(id),time:time,myid:id,stu:1});
			}
			function myfun() {
				for (var i = 0; i < list.length; i++) { 
					list[i].ele.innerHTML = Timetogo(list[i]);
					if (!list[i].time)list.splice(i--, 1); 
				}
			}
			function Timetogo(o){
				var t = new Date(o.time*1000).getTime()+43200000 - new Date().getTime();
				if(t > 0 && o.stu == 1){
					var s = parseInt(t/1000%60)<10 ? "0"+ parseInt(t/1000%60) : parseInt(t/1000%60);
					var m = parseInt(t/1000/60%60)<10 ? "0"+ parseInt(t/1000/60%60) : parseInt(t/1000/60%60);
					var h = parseInt(t/1000/60/60%24)<10 ? "0"+ parseInt(t/1000/60/60%24) : parseInt(t/1000/60/60%24);
					return "剩余" + h + ":" + m + ":" +s;
				}else if(t < 0 && o.stu == 2){
					return "订单已过时！";
				}else{
					o.stu = 2;
					//$.post("http://localhost/orderRelevant/ordertimeout",{id:o.myid})
					$.post(Server + "/orderRelevant/ordertimeout",{id:o.myid})
					yemian($("#useridoflogin").val(),5,0,1);
					infoLikeListofinfo($("#useridoflogin").val(),5,0,1);
					return "订单已过时！";
				}
			}
		}();
		